//
//  CourtCell.m
//  云律司
//
//  Created by 韦淋 on 2017/7/5.
//  Copyright © 2017年 test. All rights reserved.
//

#import "CourtCell.h"

@implementation CourtCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}
- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.lineView];
    [self.bgView addSubview:self.titleLable];
    [self.bgView addSubview:self.judicialProcedure];
    [self.bgView addSubview:self.bailor];
    [self.bgView addSubview:self.court];
    [self.bgView addSubview:self.filingDate];
    [self.bgView addSubview:self.courtDate];
    [self.bgView addSubview:self.appealDate];
    [self.bgView addSubview:self.sentenceDate];
    [self.bgView addSubview:self.remark];
}
- (void)layoutSubviews{
    
    
    self.bgView.frame = CGRectMake(5, 0, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 15);
    self.lineView.frame = CGRectMake(0, 0, self.bgView.bounds.size.width , 2);
    self.titleLable.frame = CGRectMake(10, 0, 300, 40);
    self.judicialProcedure.frame = CGRectMake(40, 40, 350, 25);
    self.bailor.frame = CGRectMake(40, 65, 350, 25);
    self.court.frame = CGRectMake(40, 90, 350, 25);
    self.filingDate.frame = CGRectMake(40, 115, 350, 25);
    self.courtDate.frame = CGRectMake(40, 140, 350, 25);
    self.appealDate.frame = CGRectMake(40, 165, 350, 25);
    self.sentenceDate.frame = CGRectMake(40, 190, 350, 25);
    self.remark.frame = CGRectMake(40, 215, 215, 25);
    for (int i = 0; i < 8; i ++) {
        UIView *dividerView = [[UIView alloc] initWithFrame:CGRectMake(0, 40 + i * 25, self.bgView.bounds.size.width , 0.5)];
        dividerView.backgroundColor = [UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f];
        [self.bgView addSubview:dividerView];
        
        NSArray *array = [NSArray array];
        array = @[@"llist_009",@"bann_03",@"llist_008",@"llist_004",@"llist_004",@"llist_004",@"llist_004",@"llist_007"];
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 42 + i * 25, 20, 20)];
        //        imageView.backgroundColor = [UIColor redColor];
        imageView.image = [UIImage imageNamed:array[i]];
        
        [self.bgView addSubview:imageView];
    }
    
    
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        //        _bgView.layer.cornerRadius=10;
        _bgView.layer.shadowColor=[UIColor lightGrayColor].CGColor;
        _bgView.layer.shadowOffset=CGSizeMake(3, 3);
        _bgView.layer.shadowOpacity=0.5;
        //        _bgView.layer.shadowRadius=5;
        //        CGPathRef path = [UIBezierPath bezierPathWithRect:CGRectMake(0, self.bounds.size.height, [UIScreen mainScreen].bounds.size.width,2)].CGPath;
        //        [_bgView setShadowPath:path];
    }
    return _bgView;
}
- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithRed:63.0f/255.0f green:189.0f/255.0f blue:240.0f/255.0f alpha:1.0f];
    }
    return _lineView;
}
- (UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc]init];
        _titleLable.textColor = [UIColor blackColor];
        _titleLable.font = [UIFont systemFontOfSize:16];
    }
    return _titleLable;
}
- (UILabel *)judicialProcedure{
    if (!_judicialProcedure) {
        _judicialProcedure = [[UILabel alloc]init];
        _judicialProcedure.textColor = [UIColor blackColor];
        _judicialProcedure.font = [UIFont systemFontOfSize:11];
    }
    return _judicialProcedure;
}


- (UILabel *)bailor{
    if (!_bailor) {
        _bailor = [[UILabel alloc]init];
        _bailor.textColor = [UIColor blackColor];
        _bailor.font = [UIFont systemFontOfSize:11];
    }
    return _bailor;
}
- (UILabel *)court{
    if (!_court) {
        _court = [[UILabel alloc]init];
        _court.textColor = [UIColor blackColor];
        _court.font = [UIFont systemFontOfSize:11];
    }
    return _court;
}- (UILabel *)filingDate{
    if (!_filingDate) {
        _filingDate = [[UILabel alloc]init];
        _filingDate.textColor = [UIColor blackColor];
        _filingDate.font = [UIFont systemFontOfSize:11];
    }
    return _filingDate;
}
- (UILabel *)courtDate{
    if (!_courtDate) {
        _courtDate = [[UILabel alloc]init];
        _courtDate.textColor = [UIColor blackColor];
        _courtDate.font = [UIFont systemFontOfSize:11];
    }
    return _courtDate;
}
- (UILabel *)appealDate{
    if (!_appealDate) {
        _appealDate = [[UILabel alloc]init];
        _appealDate.textColor = [UIColor blackColor];
        _appealDate.font = [UIFont systemFontOfSize:11];
    }
    return _appealDate;
}- (UILabel *)sentenceDate{
    if (!_sentenceDate) {
        _sentenceDate = [[UILabel alloc]init];
        _sentenceDate.textColor = [UIColor blackColor];
        _sentenceDate.font = [UIFont systemFontOfSize:11];
    }
    return _sentenceDate;
}- (UILabel *)remark{
    if (!_remark) {
        _remark = [[UILabel alloc]init];
        _remark.textColor = [UIColor blackColor];
        _remark.font = [UIFont systemFontOfSize:11];
    }
    return _remark;
}
@end
